package cn.com.pumpkin.client;


import cn.com.pumpkin.aop.Aspect;
import cn.com.pumpkin.aop.IocContainer;
import cn.com.pumpkin.aop.PointCut;
import cn.com.soalr.client.exp.Fish;
import cn.com.soalr.client.exp.Whale;


public class Client{
	public static void main(String []args) throws Exception{
		IocContainer ioc = new IocContainer();
		ioc.addBeanDefine("fish", Whale.class);
		PointCut pointCut = new PointCut("cn.com.soalr.client.exp.*", "sleep");
		Aspect aspect = new Aspect(new AroundPrintLineAdvice(), pointCut);
		ioc.setAspect(aspect);
		
		Fish fish = (Fish) ioc.getBean("fish");
		fish.sleep();
		fish.swimming();
	}
}
